package wiBase;

/**
 * Exception of WiSSim Visualizer System
 */
@SuppressWarnings("serial")
public class WiException extends Exception {
    /**
     * Type Exception: Default: for unknown exception
     */
    public static final int TYPE_DEFAULT = 0x00;
    /**
     * Type Exception: Changeable properties
     */
    public static final int TYPE_CHANGEABLE = 0x01;
    /**
     * Type Exception: Model exception. in parse time
     */
    public static final int TYPE_MODEL_EX = 0x10;
    /**
     * Field info of Exception
     */
    public static final int TYPE_INFO = 0x100;
    /**
     * Type Exception: variable is null
     */
    public static final int TYPE_NULL = 0x1000;
    /**
     * Type Exception: in a thread.
     */
    public static final int TYPE_INTERRUPTED = 0x10000;
    /**
     * Type Exception: parse error or file trace have some problem
     */
    public static final int TYPE_PARSE = 0x100000;
    
    private int _exceptionType;
    private String _exceptionMessage;
    
    /**
     * @param type: type Exception
     * @param message: detail for exception
     */
    public WiException(int type, String message) {
	this._exceptionType = type;
	this._exceptionMessage = message;
	System.out.println(message);
    }
    /**
     * @return type of exception
     */
    public int getExcepType() {
	return this._exceptionType;
    }
    /**
     * @return detail of exception
     */
    public String getExcepMessage() {
	return this._exceptionMessage;
    }
}
